import Api from '@/api/client/rebate'
import i18n from "@/lang/index";
const modalConfig = {
  pageName: 'sys:user',
  dialog: {
    title: i18n.global.t("title.21"),
    width: 800,
    appendToBody: true,
    draggable: true,
    labelWidth: "auto",
  },
  formAction: (data) => {
    console.log('edit', data)
    return new Promise((resolve, reject) => {
      Api.add(data).then((s) => {
        console.log(s)
        resolve(s)
      }).catch((e) => {
        reject(e)
      })
    })
  },
  formItems: [
    {
      type: "custom",
      label: i18n.global.t("label.64"),
      prop: "vip_level_id",
      attrs: {},
    },
    {
      type: "input",
      label: i18n.global.t("label.97"),
      prop: "bet_amount",
      attrs: {
        placeholder: i18n.global.t("hint.102"),
      }
    },
    {
      type: "input",
      label: i18n.global.t("label.98"),
      prop: "rebate_rate",
      attrs: {
        placeholder: i18n.global.t("hint.103"),
      }
    },
  ],
  formRules: {
    vip_level_id: [{ required: true, message: i18n.global.t("hint.104"), trigger: "blur" }],
    bet_amount: [{ required: true, message: i18n.global.t("hint.102"), trigger: "blur" }],
    rebate_rate: [{ required: true, message: i18n.global.t("hint.103"), trigger: "blur" }]
  },
}

export default modalConfig
